package top.ninwoo.utils.entity;

/**
 * @Author joliu
 * @Description iptables chain的实体类
 * @Date　Create in 下午10:43 2019/10/28
 */
public class ChainEntity {
    // TODO: 亟待实现的一个类
    private int id;
    private long pkts;
    private long bytes;
    private String target;
    private String prot;
    private String in;
    private String out;
    private String source;
    private String destination;

    private ChainType type;
    private String more;

    private ChainEntity() {

    }

    private ChainEntity(Builder builder) {
        this.pkts = builder.pkts;
        this.bytes = builder.bytes;
        this.destination = builder.destination;
        this.in = builder.in;
        this.out = builder.out;
        this.prot = builder.prot;
        this.source = builder.source;
        this.target = builder.target;
        this.type = builder.type;
        this.id = builder.id;
        this.more = builder.more;
    }

    public static class Builder {
        private int id;
        private long pkts;
        private long bytes;
        private String target;
        private String prot;
        private String in;
        private String out;
        private String source;
        private String destination;
        private String opt;
        private String more;
        private ChainType type;

        public Builder() {
        }

        public int id() {
            return this.id;
        }

        public Builder id(int id) {
            this.id = id;
            return this;
        }

        public String opt() {
            return this.opt;
        }

        public Builder opt(String opt) {
            this.opt = opt;
            return this;
        }

        public long pkts() {
            return this.pkts;
        }

        public Builder pkts(long pkts) {
            this.pkts = pkts;
            return this;
        }

        public long bytes() {
            return this.bytes;
        }

        public Builder bytes(long bytes) {
            this.bytes = bytes;
            return this;
        }

        public String target() {
            return this.target;
        }

        public Builder target(String target) {
            this.target = target;
            return this;
        }

        public String prot() {
            return this.prot;
        }

        public Builder prot(String prot) {
            this.prot = prot;
            return this;
        }

        public String source() {
            return this.source;
        }

        public Builder source(String source) {
            this.source = source;
            return this;
        }

        public String in() {
            return this.in;
        }

        public Builder in(String in) {
            this.in = in;
            return this;
        }

        public String out() {
            return this.out;
        }

        public Builder out(String out) {
            this.out = out;
            return this;
        }

        public String destination() {
            return this.destination;
        }

        public Builder destination(String destination) {
            this.destination = destination;
            return this;
        }

        public ChainType type() {
            return this.type;
        }


        public String more() {
            return this.more;
        }

        public Builder more(String more) {
            this.more = more;
            return this;
        }

        public Builder type(ChainType type) {
            this.type = type;
            return this;
        }

        public ChainEntity build() {
            return new ChainEntity(this);
        }
    }

    public static Builder builder() {
        return new Builder();
    }


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public long getPkts() {
        return pkts;
    }

    public void setPkts(long pkts) {
        this.pkts = pkts;
    }

    public long getBytes() {
        return bytes;
    }

    public void setBytes(long bytes) {
        this.bytes = bytes;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public String getProt() {
        return prot;
    }

    public void setProt(String prot) {
        this.prot = prot;
    }

    public String getIn() {
        return in;
    }

    public void setIn(String in) {
        this.in = in;
    }

    public String getOut() {
        return out;
    }

    public void setOut(String out) {
        this.out = out;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getDestination() {
        return destination;
    }

    public void setDestination(String destination) {
        this.destination = destination;
    }

    public ChainType getType() {
        return type;
    }

    public void setType(ChainType type) {
        this.type = type;
    }

    public String getMore() {
        return more;
    }

    public void setMore(String more) {
        this.more = more;
    }

    @Override
    public String toString() {
        return "ChainEntity{" +
                "id=" + id +
                ", pkts=" + pkts +
                ", bytes=" + bytes +
                ", target='" + target + '\'' +
                ", prot='" + prot + '\'' +
                ", in='" + in + '\'' +
                ", out='" + out + '\'' +
                ", source='" + source + '\'' +
                ", destination='" + destination + '\'' +
                ", type=" + type +
                '}';
    }
}
